package com.woniu51.order.mapper;

import com.woniu51.order.domain.Order;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;

public interface OrderMapper extends Mapper<Order> {

    //数据库的乐观锁
    @Update("update tb_order set order_status=3 where order_id=#{orderId} and order_status=1")
    public int invalidOrder(Long orderId);
    //把未付款的订单更新为已付款
    @Update("update tb_order set order_status=2 where order_id=#{orderId} and order_status=1")
    Integer confirmPay(Long orderId);

}
